package com.mornd.gulimall.order.entity.vo;

import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author: mornd
 * @dateTime: 2023/8/22 - 15:04
 */

@Data
public class OrderSubmitVo {
    @NotNull
    private Long addrId;
    @NotNull
    private Integer payType;
    // 商品集合
    @NotNull
    @NotEmpty
    List<@Valid Sku> skus;
    @NotBlank
    private String orderToken;
    @Min(0)
    @NotNull
    private BigDecimal total;
    // 订单备注
    private String note;

    @Data
    public static class Sku {
        @NotNull
        private Long skuId;
        @NotNull
        @Min(1)
        private Integer count;
    }
}
